Platform Explorer / Nuxeo Platform 5.8

Contribution org.nuxeo.ecm.rating.gadgets--gadget

This contribution is part of XML component org.nuxeo.ecm.rating.gadgets inside nuxeo-rating-gadget-5.8.jar

Extension Point

Extension point gadget of component service.

Contributed Items

  • <internalGadget disabled="false" name="mostLiked">
          <documentation>
            This gadget allows user to list most liked document from a Social Workspace or from a SuperSpace if it is added in the User Home.
            It's possible to display most liked documents from a range of date:
            - this week
            - this month
            - last week
            - last month
            - ever
    
            The following user preferences can be used to configure it:
            - contextPath: stores the last selected SuperSpace in case that the gadget is not in a Social Workspace (targetContextPath empty.)
            - dateRange: default dateRange selected, possible value: ever, this_week, this_month, last_week, last_month. Ever is the default one.
    
            How to include mostLiked gadget in a JSF context:
            <code>
              <div class="gadget-mostLiked threeQuarterWidth"/>
              <script type="text/javascript">
                jQuery('.gadget-mostLiked').openSocialGadget({
                  baseURL: '#{baseURL}',
                  language: '#{localeSelector.language}',
                  gadgetDefs: [
                    { specUrl: '#{gadgetsBaseURL}/site/gadgets/mostLiked/mostLiked.xml',
                      title: 'My most liked document',
                      userPrefs: {
                        contextPath: {
                          value: '/default-domain/'
                        },
                        dateRange: {
                          value: 'last_week'
                        }
                      },
                      displayTitleBar: false,
                      width: '100%'
                    }
                  ]
                });
              </script>
            </code>
    
            How to include the wall gadget in a WebEngine page:
            <code>
              <link href="${contextPath}/css/opensocial/light-container-gadgets.css" rel="stylesheet"/>
              <script src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1" type="text/javascript"/>
              <script src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js" type="text/javascript"/>
    
              <div class="gadget-mostLiked gadgets-gadget-chrome"/>
              <script type="text/javascript">
                $('.gadget-mostLiked').openSocialGadget({
                  baseURL: '${contextPath}' + '/',
                  language: '${Context.locale.language}',
                  gadgetDefs: [{
                    specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/mostLiked/mostLiked.xml',
                    userPrefs: {
                      contextPath: {
                        value: '/default-domain/'
                      },
                      dateRange: {
                        value: 'last_week'
                      }
                    },
                    displayTitleBar: false,
                    width: '100%'
                  }]
                });
              </script>
            </code>
          </documentation>
          <mountPoint>/mostLiked</mountPoint>
          <entryPoint>mostLiked.xml</entryPoint>
          <category>Nuxeo</category>
          <icon>gadget-mostLiked.png</icon>
        </internalGadget>

    This gadget allows user to list most liked document from a Social Workspace or from a SuperSpace if it is added in the User Home. It's possible to display most liked documents from a range of date: - this week - this month - last week - last month - ever The following user preferences can be used to configure it: - contextPath: stores the last selected SuperSpace in case that the gadget is not in a Social Workspace (targetContextPath empty.) - dateRange: default dateRange selected, possible value: ever, this_week, this_month, last_week, last_month. Ever is the default one. How to include mostLiked gadget in a JSF context: How to include the wall gadget in a WebEngine page:

XML Source

<extension point="gadget" target="org.nuxeo.opensocial.gadgets.service">

    <internalGadget disabled="false" name="mostLiked">
      <documentation>
        This gadget allows user to list most liked document from a Social Workspace or from a SuperSpace if it is added in the User Home.
        It's possible to display most liked documents from a range of date:
        - this week
        - this month
        - last week
        - last month
        - ever

        The following user preferences can be used to configure it:
        - contextPath: stores the last selected SuperSpace in case that the gadget is not in a Social Workspace (targetContextPath empty.)
        - dateRange: default dateRange selected, possible value: ever, this_week, this_month, last_week, last_month. Ever is the default one.

        How to include mostLiked gadget in a JSF context:
        <code>
          <div class="gadget-mostLiked threeQuarterWidth"/>
          <script type="text/javascript">
            jQuery('.gadget-mostLiked').openSocialGadget({
              baseURL: '#{baseURL}',
              language: '#{localeSelector.language}',
              gadgetDefs: [
                { specUrl: '#{gadgetsBaseURL}/site/gadgets/mostLiked/mostLiked.xml',
                  title: 'My most liked document',
                  userPrefs: {
                    contextPath: {
                      value: '/default-domain/'
                    },
                    dateRange: {
                      value: 'last_week'
                    }
                  },
                  displayTitleBar: false,
                  width: '100%'
                }
              ]
            });
          </script>
        </code>

        How to include the wall gadget in a WebEngine page:
        <code>
          <link href="${contextPath}/css/opensocial/light-container-gadgets.css" rel="stylesheet"/>
          <script src="${contextPath}/opensocial/gadgets/js/rpc.js?c=1" type="text/javascript"/>
          <script src="${contextPath}/js/?scripts=jquery.js|opensocial/cookies.js|opensocial/util.js|opensocial/gadgets.js|opensocial/cookiebaseduserprefstore.js|opensocial/jquery.opensocial.gadget.js" type="text/javascript"/>

          <div class="gadget-mostLiked gadgets-gadget-chrome"/>
          <script type="text/javascript">
            $('.gadget-mostLiked').openSocialGadget({
              baseURL: '${contextPath}' + '/',
              language: '${Context.locale.language}',
              gadgetDefs: [{
                specUrl : '${Runtime.getProperty('nuxeo.loopback.url')}/site/gadgets/mostLiked/mostLiked.xml',
                userPrefs: {
                  contextPath: {
                    value: '/default-domain/'
                  },
                  dateRange: {
                    value: 'last_week'
                  }
                },
                displayTitleBar: false,
                width: '100%'
              }]
            });
          </script>
        </code>
      </documentation>
      <mountPoint>/mostLiked</mountPoint>
      <entryPoint>mostLiked.xml</entryPoint>
      <category>Nuxeo</category>
      <icon>gadget-mostLiked.png</icon>
    </internalGadget>

  </extension>